<template>
  <div class="component-allotMaterialList">
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>
            <span v-if="$route.params.loop==1" ><a @click="$router.go(-2)">库存</a> > <a  @click="$router.go(-1)"> 查看记录</a> >  内部调拨 </span>
            <span v-else>内部调拨 </span>
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe662;</span>后退
          </el-button>
        </div>
      </div>
    </div>
    <div  class="container">
      <div>
        <div class="table-title">
          <p>
            <span class="iconfont">&#xe607;</span> 调拨信息
          </p>
        </div>
        <div class="tables">
          <table cellpadding="0" cellspacing="0" border="1">
            <tr>
              <td>调拨单号</td>
              <td>{{info.store.formNo}}</td>
              <td>调拨日期</td>
              <td>{{info.store.outDate | dateFilter }}</td>
            </tr>
            <tr>
              <td>领料施工队</td>
              <td>{{info.store.receiverName}}</td>
              <td>出料施工队</td>
              <td>{{info.store.supplierName}}</td>
            </tr>
     <!--       <tr>
              <td>签收单据</td>
              <td @click="imgFlag = !imgFlag">{{info.signData.fileName}}</td>
              <td>出库单据</td>
              <td @click="imgFlags = !imgFlags">{{info.outSignData.fileName}}</td>
            </tr>-->
          </table>
        </div>
      </div>
      <div style="margin-top:20px;">
        <div class="table-title">
          <p>
            <span class="iconfont">&#xe607;</span> 材料清单
          </p>
        </div>
        <div class="table">
          <el-table
            ref="multipleTable"
            :data="materialList"
            tooltip-effect="dark"
            style="width: 1100px;margin:0 auto"
            border
          >
            <el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
            <el-table-column label="材料名称" align="center" prop="matName"></el-table-column>
            <el-table-column label="型号" align="center" prop="matModel"></el-table-column>
            <el-table-column label="单位" align="center" prop="matUnit"></el-table-column>
            <el-table-column label="出料数量" align="center" prop="outNum"></el-table-column>
            <!--<el-table-column label="领料数量" align="center" prop></el-table-column>-->
          </el-table>
        </div>
      </div>
    </div>

    <!--签收单据-图片预览-->
    <div class="component-model">
      <el-dialog title="预览" :visible.sync="imgFlag" width="600px">
        <img :src="exe_img + info.signData.fileUrl" style="max-width: 500px;">
      </el-dialog>
    </div>
    <!--出库-图片预览-->
    <div class="component-model">
      <el-dialog title="预览" :visible.sync="imgFlags" width="600px">
        <img :src="exe_img + info.outSignData.fileUrl" style="max-width: 500px;">
      </el-dialog>
    </div>


  </div>
</template>

<script>
  export default {
    data() {
      return {
        //   移动系统资料（驻点）表格数据
        moveSystemData: [],
        moveSystem: {
          num1: ""
        },

        //   跳纤
        materialList: [],
        info:{
          store:{
            formNo:'',
            outDate:'',
            receiverName:'',
            supplierName:''
          },
          signData:{
            fileName:'',
            fileUrl:''
          },
          outSignData:{
            fileName:'',
            fileUrl:''
          }
        },//调拨信息
        exe_img:img_url,//图片前缀
        imgFlag:false,
        imgFlags:false,
      };
    },
    mounted(){
      this.dataInit();
    },
    methods: {
      save() {},
      dataInit(){
        let that = this;
        let suCb = function(res){
          that.info = res.data.data;
          that.materialList = res.data.data.list;
          console.log(that.info)
        }
        let erCb = function(res){
          console.log(res)
        }
        let postData = {
//          '05e4-90af-46f2-b8e4-6c96143c57e6'
            outId:that.$route.params.outId
        }
        let palyParam = {
          url: "/api/web/proInStore/getInfoByOutId",
          methods:'post',
          data: postData,
          success: suCb,
          error: erCb,
        }
        that.$https(palyParam)
      }
    }
  };
</script>

<style scoped>
  .container {
    width: 1100px;
    margin: 30px auto;
  }
  .table-title p {
    font-family: "PingFangSC-Regular", "PingFang SC";
    font-weight: 400;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
    font-size: 16px;
    color: #666;
    text-align: left;
    line-height: 40px;
  }

  .tables table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
    padding: 0;
    border: none;
    font-size: 12px;
  }
  .tables table td{
    height: 40px;
  }
  .tables table td:nth-of-type(2n + 1) {
    text-align: right;
    padding-right: 20px;
    width: 140px !important;
    background: #f9fafc;
  }
  .tables table td:nth-of-type(2n + 2){
    width: 220px;
  }

  .table-title > div:last-of-type {
    float: right;
    margin: -45px 20px 10px;
  }
  .table-title > div:last-of-type span {
    display: inline-block;
    margin-left: 20px;
    padding: 5px 20px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 4px;
  }
  .table-title > div:last-of-type span:first-of-type {
    border: 1px solid #e4e4e4;
    color: #666;
    background: #fff;
  }
  .table-title > div:last-of-type span:last-of-type {
    border: 1px solid #1abc9c;
    color: #fff;
    background: #1abc9c;
  }

  .uploadBtn{
    height: 26px;
    line-height: 26px;
    margin: 7px;
    width: 90px;
    color: #1abc9c;
    border: 1px solid #1abc9c;
    background-color: #fff;
  }
  .uploadBtn:hover{
    color: #fff;
    background-color: #1abc9c;
  }
</style>
